<!DOCTYPE HTML>
<html  lang="zh" xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="white-bg bgys">
<div class="wrapper wrapper-content animated fadeInRight ibox-content bgystz">

    <form class="form-horizontal m" id="form-trade-edit" th:object="${trade}">
        <input id="id" name="id" th:field="*{id}"  type="hidden">
        <input id="pointId" name="pointId" th:field="*{pointId}"  type="hidden">
        <input id="basicsId" name="basicsId" th:field="*{basicsId}"  type="hidden">

        <div class="col-md-3">
            <div class="form-group">
                <label class="col-sm-4 control-label bgys"><label class="spty">*</label>平均容量或需量:</label>
                <div class="col-sm-8">
                    <input id="averageVolume" name="averageVolume" th:field="*{averageVolume}" class="form-control tx"
                           type="number">
                </div>
            </div>
        </div>
        <div class="col-md-3">
            <div class="form-group">
                <label class="col-sm-4 control-label bgys" ><label class="spty">*</label>基本电价：</label>
                <div class="col-sm-8">
                    <input id="basicsPrice" name="basicsPrice" th:field="*{basicsPrice}" class="form-control tx"
                           aria-level=""  type="number"   >
                </div>
            </div>
        </div>
        <!--<div class="col-md-3">
            <div class="form-group">
                <label class="col-sm-4 control-label">直购电/自备替代：</label>
                <div class="col-sm-8">
                    &lt;!&ndash;<input id="directEle" name="directEle" th:field="*{directEle}" class="form-control" type="number">&ndash;&gt;
                    <select id="directEle"  name="directEle" class="form-control m-b" th:with="type=${@dict.getType('user_type')}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{directEle}"></option>
                    </select>
                </div>
            </div>
        </div>-->
        <div class="col-md-3">
            <div class="form-group">
                <label class="col-sm-4 control-label bgys"  th:alt-title="基本电价乘以平均容量或需量">基本电费:</label>
                <div class="col-sm-8">
                    <input id="basicsCost" name="basicsCost" th:field="*{basicsCost}" class="form-control srk"
                           type="number" readonly="true">
                </div>
            </div>
        </div>

        <div class="col-md-12">
            <hr style="height:1px;border:none;border-top:1px solid #555555;" />
        </div>
        <div class="col-md-3"  th:hidden="${month!='丰'}">
            <div class="form-group">
                <label class="col-sm-4 control-label bgys"><label class="spty">*</label>峰段：</label>
                <div class="col-sm-8">
                    <input id="fF" name="fF" th:field="*{fF}" class="form-control tx" type="number">
                </div>
            </div>
        </div>

        <div class="col-md-3"  th:hidden="${month!='丰'}">
            <div class="form-group">
                <label class="col-sm-4 control-label bgys"><label class="spty">*</label>平段：</label>
                <div class="col-sm-8">
                    <input id="fP" name="fP" th:field="*{fP}" class="form-control tx" type="number">
                </div>
            </div>
        </div>
        <div class="col-md-3"  th:hidden="${month!='丰'}">
            <div class="form-group">
                <label class="col-sm-4 control-label bgys"><label class="spty">*</label>谷段：</label>
                <div class="col-sm-8">
                    <input id="fG" name="fG" th:field="*{fG}" class="form-control tx" type="number">
                </div>
            </div>
        </div>

        <div class="col-md-3"  th:hidden="${month!='丰'}">
            <div class="form-group">
                <label class="col-sm-4 control-label bgys" th:alt-title="丰水期电量峰段加丰水期电量平段加丰水期电量谷段">小计：</label>
                <div class="col-sm-8">
                    <input id="fTotal" name="fTotal" th:field="*{fTotal}" class="form-control srk"
                           readonly="true"   type="number">
                </div>
            </div>
        </div>

        <div class="col-md-12">
        </div>

        <div class="col-md-3"  th:hidden="${month!='平'}">
            <div class="form-group">
                <label class="col-sm-4 control-label bgys"><label class="spty">*</label>峰段：</label>
                <div class="col-sm-8">
                    <input id="pF" name="pF" th:field="*{pF}" class="form-control tx"  type="number">
                </div>
            </div>
        </div>

        <div class="col-md-3"  th:hidden="${month!='平'}">
            <div class="form-group">
                <label class="col-sm-4 control-label bgys"><label class="spty">*</label>平段：</label>
                <div class="col-sm-8">
                    <input id="pP" name="pP" th:field="*{pP}" class="form-control tx" type="number">
                </div>
            </div>
        </div>
        <div class="col-md-3"  th:hidden="${month!='平'}">
            <div class="form-group">
                <label class="col-sm-4 control-label bgys"><label class="spty">*</label>谷段：</label>
                <div class="col-sm-8">
                    <input id="pG" name="pG" th:field="*{pG}" class="form-control tx" type="number">
                </div>
            </div>
        </div>

        <div class="col-md-3"  th:hidden="${month!='平'}">
            <div class="form-group">
                <label class="col-sm-4 control-label bgys" th:alt-title="平水期电量峰段加平水期电量平段加平水期电量谷段">小计：</label>
                <div class="col-sm-8">
                    <input id="pTotal" name="pTotal" th:field="*{pTotal}" class="form-control srk"
                           readonly="true" type="number">
                </div>
            </div>
        </div>

        <div class="col-md-12">
        </div>

        <div class="col-md-3"  th:hidden="${month!='枯'}">
            <div class="form-group">
                <label class="col-sm-4 control-label bgys"><label class="spty">*</label>峰段：</label>
                <div class="col-sm-8">
                    <input id="kF" name="kF" th:field="*{kF}" class="form-control tx" type="number">
                </div>
            </div>
        </div>

        <div class="col-md-3"  th:hidden="${month!='枯'}">
            <div class="form-group">
                <label class="col-sm-4 control-label bgys"><label class="spty">*</label>平段：</label>
                <div class="col-sm-8">
                    <input id="kP" name="kP" th:field="*{kP}" class="form-control tx" type="number">
                </div>
            </div>
        </div>
        <div class="col-md-3"  th:hidden="${month!='枯'}">
            <div class="form-group">
                <label class="col-sm-4 control-label bgys"><label class="spty">*</label>谷段：</label>
                <div class="col-sm-8">
                    <input id="kG" name="kG" th:field="*{kG}" class="form-control tx" type="number">
                </div>
            </div>
        </div>

        <div class="col-md-3"  th:hidden="${month!='枯'}">
            <div class="form-group">
                <label class="col-sm-4 control-label bgys" th:alt-title="枯水期电量峰段加枯水期电量平段加枯水期电量谷段">小计：</label>
                <div class="col-sm-8">
                    <input id="kTotal" name="kTotal" th:field="*{kTotal}" class="form-control srk"
                           readonly="true" type="number">
                </div>
            </div>
        </div>
        <div class="col-md-12">

        </div>
        <!--<div class="col-md-3">-->

        <!--</div>-->
        <!--<div class="col-md-3">-->

        <!--</div>-->
        <!--<div class="col-md-3">-->

        <!--</div>-->
        <div class="col-md-3" style="display:none;">
            <div class="form-group">
                <label class="col-sm-4 control-label bgys" th:alt-title="峰水期电量小计加平水期电量小计加枯水期电量小计">交易电量合计：</label>
                <div class="col-sm-8">
                    <input id="tradeTotal" name="tradeTotal" th:field="*{tradeTotal}" class="form-control srk"
                           readonly="true"  type="number">
                </div>
            </div>
        </div>
        <div class="col-md-12">
            <hr style="height:1px;border:none;border-top:1px solid #555555;" />

        </div>

        <div class="col-md-4">
            <div class="form-group">
                <label class="col-sm-4 control-label bgys" ><label class="spty">*</label>电厂交易价格：</label>
                <div class="col-sm-8">
                    <input id="factoryPrice" name="factoryPrice" th:field="*{factoryPrice}"
                           class="form-control tx"   type="number">
                </div>
            </div>
        </div>
        <div class="col-md-4">
            <div class="form-group">
                <label class="col-sm-4 control-label bgys" th:alt-title="电厂交易价格乘以交易电量合计">上网电费：</label>
                <div class="col-sm-8">
                    <input id="upCost" name="upCost" th:field="*{upCost}"  class="form-control srk"
                           readonly="true" type="number">
                </div>
            </div>
        </div>

        <div class="col-md-4">
        </div>

        <div class="col-md-12">
        </div>
        <div class="col-md-4">
            <div class="form-group">
                <label class="col-sm-4 control-label bgys" ><label class="spty">*</label>输配电价：</label>
                <div class="col-sm-8">
                    <input id="sPPrice" name="sPPrice" th:field="*{sPPrice}" class="form-control tx"
                           type="number">
                </div>
            </div>
        </div>
        <div class="col-md-4">
            <div class="form-group">
                <label class="col-sm-4 control-label bgys"  th:alt-title="输配电价乘以交易电量合计">输配收入金额：</label>
                <div class="col-sm-8">
                    <input id="sPAccount" name="sPAccount" th:field="*{sPAccount}" class="form-control srk"
                           readonly="true"  type="number">
                </div>
            </div>
        </div>

        <div class="col-md-4">
        </div>
        <div class="col-md-12">
        </div>
        <div class="col-md-4">
            <div class="form-group">
                <label class="col-sm-4 control-label bgys" ><label class="spty">*</label>基金均价：</label>
                <div class="col-sm-8">
                    <input id="jJAverage" name="jJAverage" th:field="*{jJAverage}"
                           class="form-control tx"  type="number">
                </div>
            </div>
        </div>

        <div class="col-md-4">
            <div class="form-group">
                <label class="col-sm-4 control-label bgys" th:alt-title="基金均价乘以交易电量合计">政府性基金及附加：</label>
                <div class="col-sm-8">
                    <input id="jJAcount" name="jJAcount" th:field="*{jJAcount}" class="form-control srk"
                           readonly="true"  type="number">
                </div>
            </div>
        </div>

        <div class="col-md-4">
        </div>

        <div class="col-md-12">
        </div>
        <div class="col-md-4">
            <div class="form-group">
                <label class="col-sm-4 control-label bgys"    >到户均价：</label>
                <div class="col-sm-8">
                    <input id="dHAverage" name="dHAverage" th:field="*{dHAverage}"
                           class="form-control srk"  type="number" readonly="true">
                </div>
            </div>
        </div>
        <div class="col-md-4">
            <div class="form-group">
                <label class="col-sm-4 control-label bgys" th:alt-title="到户均价乘以交易电量合计" >用户承担电费金额：</label>
                <div class="col-sm-8">
                    <input id="eleAcount" name="eleAcount" th:field="*{eleAcount}" class="form-control srk"
                           readonly="true" type="number">
                </div>
            </div>
        </div>

        <div class="col-md-4">
            <a class="btn btn-success" onclick="submitHandler()" >
                <i class="fa fa-hand-peace-o"></i> 计算
            </a>
        </div>









    </form>
</div>
<div th:include="include::footer"></div>
<script type="text/javascript">
    var prefix = ctx + "service/trade"
    $("#form-trade-edit").validate({
        rules:{
            averageVolume:{
                required:true,
            },
            basicsPrice:{
                required:true,
            },
            directEle:{
                required:true,
            },
            fF:{
                required:true,
            },
            fP:{
                required:true,
            },
            fG:{
                required:true,
            },
            pF:{
                required:true,
            },
            pP:{
                required:true,
            },
            pG:{
                required:true,
            },
            kF:{
                required:true,
            },
            kP:{
                required:true,
            },
            kG:{
                required:true,
            },
            factoryPrice:{
                required:true,
            },
            sPPrice:{
                required:true,
            },
            jJAverage:{
                required:true,
            },

        }
    });

    function submitHandler() {
        console.log("saveAndRefer");
        if ($.validate.form()) {
            $.operate.saveAndRefer(prefix + "/edit", $('#form-trade-edit').serialize());
        }
    }

</script>
</body>
</html>
